Optimal. Leaf size=105 \[ \frac{2 a^2 c^2 \tan ^3(e+f x)}{3 f (a \sec (e+f x)+a)^{3/2}}+\frac{2 \sqrt{a} c^2 \tan ^{-1}\left (\frac{\sqrt{a} \tan (e+f x)}{\sqrt{a \sec (e+f x)+a}}\right )}{f}-\frac{2 a c^2 \tan (e+f x)}{f \sqrt{a \sec (e+f x)+a}} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.158486, antiderivative size = 105, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 4, integrand size = 28, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.143, Rules used = {3904, 3887, 302, 203} \[ \frac{2 a^2 c^2 \tan ^3(e+f x)}{3 f (a \sec (e+f x)+a)^{3/2}}+\frac{2 \sqrt{a} c^2 \tan ^{-1}\left (\frac{\sqrt{a} \tan (e+f x)}{\sqrt{a \sec (e+f x)+a}}\right )}{f}-\frac{2 a c^2 \tan (e+f x)}{f \sqrt{a \sec (e+f x)+a}} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3904
Rule 3887
Rule 302
Rule 203
Rubi steps
\begin{align*} \int \sqrt{a+a \sec (e+f x)} (c-c \sec (e+f x))^2 \, dx &=\left (a^2 c^2\right ) \int \frac{\tan ^4(e+f x)}{(a+a \sec (e+f x))^{3/2}} \, dx\\ &=-\frac{\left (2 a^3 c^2\right ) \operatorname{Subst}\left (\int \frac{x^4}{1+a x^2} \, dx,x,-\frac{\tan (e+f x)}{\sqrt{a+a \sec (e+f x)}}\right )}{f}\\ &=-\frac{\left (2 a^3 c^2\right ) \operatorname{Subst}\left (\int \left (-\frac{1}{a^2}+\frac{x^2}{a}+\frac{1}{a^2 \left (1+a x^2\right )}\right ) \, dx,x,-\frac{\tan (e+f x)}{\sqrt{a+a \sec (e+f x)}}\right )}{f}\\ &=-\frac{2 a c^2 \tan (e+f x)}{f \sqrt{a+a \sec (e+f x)}}+\frac{2 a^2 c^2 \tan ^3(e+f x)}{3 f (a+a \sec (e+f x))^{3/2}}-\frac{\left (2 a c^2\right ) \operatorname{Subst}\left (\int \frac{1}{1+a x^2} \, dx,x,-\frac{\tan (e+f x)}{\sqrt{a+a \sec (e+f x)}}\right )}{f}\\ &=\frac{2 \sqrt{a} c^2 \tan ^{-1}\left (\frac{\sqrt{a} \tan (e+f x)}{\sqrt{a+a \sec (e+f x)}}\right )}{f}-\frac{2 a c^2 \tan (e+f x)}{f \sqrt{a+a \sec (e+f x)}}+\frac{2 a^2 c^2 \tan ^3(e+f x)}{3 f (a+a \sec (e+f x))^{3/2}}\\ \end{align*}
Mathematica [A] time = 0.772085, size = 97, normalized size = 0.92 \[ -\frac{2 c^2 \tan \left (\frac{1}{2} (e+f x)\right ) \sec (e+f x) \sqrt{a (\sec (e+f x)+1)} \left ((4 \cos (e+f x)-1) \sqrt{\sec (e+f x)-1}-3 \cos (e+f x) \tan ^{-1}\left (\sqrt{\sec (e+f x)-1}\right )\right )}{3 f \sqrt{\sec (e+f x)-1}} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.263, size = 142, normalized size = 1.4 \begin{align*} -{\frac{{c}^{2}}{3\,f\sin \left ( fx+e \right ) \cos \left ( fx+e \right ) } \left ( 3\,\sqrt{2}\cos \left ( fx+e \right ) \sin \left ( fx+e \right ) \sqrt{-2\,{\frac{\cos \left ( fx+e \right ) }{1+\cos \left ( fx+e \right ) }}}{\it Artanh} \left ( 1/2\,{\frac{\sqrt{2}\sin \left ( fx+e \right ) }{\cos \left ( fx+e \right ) }\sqrt{-2\,{\frac{\cos \left ( fx+e \right ) }{1+\cos \left ( fx+e \right ) }}}} \right ) -8\, \left ( \cos \left ( fx+e \right ) \right ) ^{2}+10\,\cos \left ( fx+e \right ) -2 \right ) \sqrt{{\frac{a \left ( 1+\cos \left ( fx+e \right ) \right ) }{\cos \left ( fx+e \right ) }}}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.17203, size = 792, normalized size = 7.54 \begin{align*} \left [\frac{3 \,{\left (c^{2} \cos \left (f x + e\right )^{2} + c^{2} \cos \left (f x + e\right )\right )} \sqrt{-a} \log \left (\frac{2 \, a \cos \left (f x + e\right )^{2} - 2 \, \sqrt{-a} \sqrt{\frac{a \cos \left (f x + e\right ) + a}{\cos \left (f x + e\right )}} \cos \left (f x + e\right ) \sin \left (f x + e\right ) + a \cos \left (f x + e\right ) - a}{\cos \left (f x + e\right ) + 1}\right ) - 2 \,{\left (4 \, c^{2} \cos \left (f x + e\right ) - c^{2}\right )} \sqrt{\frac{a \cos \left (f x + e\right ) + a}{\cos \left (f x + e\right )}} \sin \left (f x + e\right )}{3 \,{\left (f \cos \left (f x + e\right )^{2} + f \cos \left (f x + e\right )\right )}}, -\frac{2 \,{\left (3 \,{\left (c^{2} \cos \left (f x + e\right )^{2} + c^{2} \cos \left (f x + e\right )\right )} \sqrt{a} \arctan \left (\frac{\sqrt{\frac{a \cos \left (f x + e\right ) + a}{\cos \left (f x + e\right )}} \cos \left (f x + e\right )}{\sqrt{a} \sin \left (f x + e\right )}\right ) +{\left (4 \, c^{2} \cos \left (f x + e\right ) - c^{2}\right )} \sqrt{\frac{a \cos \left (f x + e\right ) + a}{\cos \left (f x + e\right )}} \sin \left (f x + e\right )\right )}}{3 \,{\left (f \cos \left (f x + e\right )^{2} + f \cos \left (f x + e\right )\right )}}\right ] \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F] time = 0., size = 0, normalized size = 0. \begin{align*} c^{2} \left (\int - 2 \sqrt{a \sec{\left (e + f x \right )} + a} \sec{\left (e + f x \right )}\, dx + \int \sqrt{a \sec{\left (e + f x \right )} + a} \sec ^{2}{\left (e + f x \right )}\, dx + \int \sqrt{a \sec{\left (e + f x \right )} + a}\, dx\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]